package com.tyoj.tyojbackendjudgeservice.codesanbox;


import com.tyoj.tyojbackendjudgeservice.codesanbox.mode.dto.ExecuteCodeRequest;
import com.tyoj.tyojbackendjudgeservice.codesanbox.mode.dto.ExcuteCodeResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CodeSandboxProxy implements CodeSandbox {

    private CodeSandbox codeSandbox;

    public CodeSandboxProxy(CodeSandbox codeSandbox) {
        this.codeSandbox = codeSandbox;
    }

    @Override
    public ExcuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("代码沙箱请求信息:", executeCodeRequest.toString());
        ExcuteCodeResponse excuteCodeResponse = codeSandbox.executeCode(executeCodeRequest);
        log.info("代码沙箱返回信息:", excuteCodeResponse);
        return excuteCodeResponse;
    }
}
